# -*- coding: iso-8859-1 -*-
#
#    This is part of Malvinas Argentinas Messenger
#
#    Malvinas Argentinas Messenger is free software; you can redistribute
#    it and/or modify it under the terms of the GNU General Public License
#    as published by the Free Software Foundation; either version 2 of the
#    License, or (at your option) any later version.
#
#    Malvinas Argentinas Messenger is distributed in the hope that it will be
#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Malvinas Argentinas Messenger; if not, write to the Free 
#    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 
#    MA  02110-1301  USA

import curses

class colors:
	# Here we define all the colors
	def __init__(self):
		curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
		curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
		curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
		curses.init_pair(4, curses.COLOR_CYAN, curses.COLOR_BLACK)
		curses.init_pair(5, curses.COLOR_YELLOW, curses.COLOR_BLACK)
		curses.init_pair(6, curses.COLOR_GREEN, curses.COLOR_BLACK)
		curses.init_pair(7, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
		curses.init_pair(8, curses.COLOR_BLACK, curses.COLOR_BLACK)
		curses.init_pair(9, curses.COLOR_WHITE, curses.COLOR_WHITE)
		curses.init_pair(10, curses.COLOR_BLUE, curses.COLOR_WHITE)
		curses.init_pair(11, curses.COLOR_RED, curses.COLOR_WHITE)
		curses.init_pair(12, curses.COLOR_CYAN, curses.COLOR_WHITE)
		curses.init_pair(13, curses.COLOR_YELLOW, curses.COLOR_BLUE)
		curses.init_pair(14, curses.COLOR_WHITE, curses.COLOR_CYAN)
		curses.init_pair(15, curses.COLOR_BLACK, curses.COLOR_WHITE)
		
		# General colors
		self.WHITE = curses.color_pair(1)
		self.BLUE = curses.color_pair(2)
		self.RED = curses.color_pair(3)
		self.CYAN = curses.color_pair(4)
		self.YELLOW = curses.color_pair(5)
		self.GREEN = curses.color_pair(6)
		self.MAGENTA = curses.color_pair(7)
		self.BLACK = curses.color_pair(8)
		self.WHITE_R = curses.color_pair(1) + curses.A_BOLD
		self.BLUE_R = curses.color_pair(2) + curses.A_BOLD
		self.RED_R = curses.color_pair(3)  + curses.A_BOLD
		self.CYAN_R = curses.color_pair(4) + curses.A_BOLD
		self.YELLOW_R = curses.color_pair(5) + curses.A_BOLD
		self.GREEN_R = curses.color_pair(6)  + curses.A_BOLD
		self.MAGENTA_R = curses.color_pair(7) + curses.A_BOLD
		self.BLACK_R = curses.color_pair(8) + curses.A_BOLD
		self.WHITE_I = curses.color_pair(1) + curses.A_BLINK
		self.BLUE_I = curses.color_pair(2) + curses.A_BLINK
		self.RED_I = curses.color_pair(3)  + curses.A_BLINK
		self.CYAN_I = curses.color_pair(4) + curses.A_BLINK
		self.YELLOW_I = curses.color_pair(5) + curses.A_BLINK
		self.GREEN_I = curses.color_pair(6)  + curses.A_BLINK
		self.MAGENTA_I = curses.color_pair(7) + curses.A_BLINK
		self.BLACK_I = curses.color_pair(8) + curses.A_BLINK
		self.WHITE_RI = curses.color_pair(1) + curses.A_BOLD + curses.A_BLINK
		self.BLUE_RI = curses.color_pair(2) + curses.A_BLINK + curses.A_BOLD
		self.RED_RI = curses.color_pair(3)  + curses.A_BOLD + curses.A_BLINK
		self.CYAN_RI = curses.color_pair(4) + curses.A_BOLD + curses.A_BLINK
		self.YELLOW_RI = curses.color_pair(5) + curses.A_BOLD + curses.A_BLINK
		self.GREEN_RI = curses.color_pair(6)  + curses.A_BOLD + curses.A_BLINK
		self.MAGENTA_RI = curses.color_pair(7) + curses.A_BOLD + curses.A_BLINK
		self.BLACK_RI = curses.color_pair(8) + curses.A_BOLD + curses.A_BLINK
		
		# Colors used for option windows and other selection stuff
		self.BLUE_WHITE_BG = curses.color_pair(10)
		self.BLUE_WHITE_BG_R = curses.color_pair(10) + curses.A_BOLD
		self.WHITE_WHITE_BG_R = curses.color_pair(9) + curses.A_BOLD
		self.WHITE_CYAN_BG = curses.color_pair(14) + curses.A_BOLD
		self.BLACK_WHITE_B = curses.color_pair(15) + curses.A_BOLD

		# Not default used
		self.WHITE_Rev = curses.color_pair(9)
		self.BLUE_Rev = curses.color_pair(10)
		self.RED_Rev = curses.color_pair(11)
		self.CYAN_Rev = curses.color_pair(12)
		self.YELLOW_Rev = curses.color_pair(13)
		self.GREEN_Rev = curses.color_pair(14)
		self.MAGENTA_Rev = curses.color_pair(15)
		self.BLACK_Rev = curses.color_pair(16)
		self.WHITE_Rev_R = curses.color_pair(9) + curses.A_BOLD
		self.BLUE_Rev_R = curses.color_pair(10) + curses.A_BOLD
		self.RED_Rev_R = curses.color_pair(11) + curses.A_BOLD
		self.CYAN_Rev_R = curses.color_pair(12) + curses.A_BOLD
		self.YELLOW_Rev_R = curses.color_pair(13) + curses.A_BOLD
		self.GREEN_Rev_R = curses.color_pair(14) + curses.A_BOLD
		self.MAGENTA_Rev_R = curses.color_pair(15) + curses.A_BOLD
		self.BLACK_Rev_R = curses.color_pair(16) + curses.A_BOLD
		self.WHITE_V= curses.color_pair(1) + curses.A_REVERSE
		self.BLUE_V = curses.color_pair(2) + curses.A_REVERSE
		self.RED_V = curses.color_pair(3) + curses.A_REVERSE
		self.CYAN_V = curses.color_pair(4) + curses.A_REVERSE
		self.YELLOW_V = curses.color_pair(5) + curses.A_REVERSE
		self.GREEN_V = curses.color_pair(6) + curses.A_REVERSE
		self.MAGENTA_V = curses.color_pair(7) + curses.A_REVERSE
		self.BLACK_V = curses.color_pair(8) + curses.A_REVERSE
		self.WHITE_RV = curses.color_pair(1) + curses.A_BOLD + curses.A_REVERSE
		self.BLUE_RV = curses.color_pair(2) + curses.A_BOLD + curses.A_REVERSE
		self.RED_RV = curses.color_pair(3)  + curses.A_BOLD + curses.A_REVERSE
		self.CYAN_RV = curses.color_pair(4) + curses.A_BOLD + curses.A_REVERSE
		self.YELLOW_RV = curses.color_pair(5) + curses.A_BOLD + curses.A_REVERSE
		self.GREEN_RV = curses.color_pair(6)  + curses.A_BOLD + curses.A_REVERSE
		self.MAGENTA_RV = curses.color_pair(7) + curses.A_BOLD + curses.A_REVERSE
		self.BLACK_RV = curses.color_pair(8) + curses.A_BOLD + curses.A_REVERSE
		self.WHITE_IV = curses.color_pair(1) + curses.A_BLINK + curses.A_REVERSE
		self.BLUE_IV = curses.color_pair(2) + curses.A_BLINK + curses.A_REVERSE
		self.RED_IV = curses.color_pair(3) + curses.A_BLINK + curses.A_REVERSE
		self.CYAN_IV = curses.color_pair(4) + curses.A_BLINK + curses.A_REVERSE
		self.YELLOW_IV = curses.color_pair(5) + curses.A_BLINK + curses.A_REVERSE
		self.GREEN_IV = curses.color_pair(6)  + curses.A_BLINK + curses.A_REVERSE
		self.MAGENTA_IV = curses.color_pair(7) + curses.A_BLINK + curses.A_REVERSE
		self.BLACK_IV = curses.color_pair(8) + curses.A_BLINK + curses.A_REVERSE
		self.WHITE_RIV = curses.color_pair(1) + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.BLUE_RIV = curses.color_pair(2) + curses.A_BLINK + curses.A_BOLD + curses.A_REVERSE
		self.RED_RIV = curses.color_pair(3)  + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.CYAN_RIV = curses.color_pair(4) + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.YELLOW_RIV = curses.color_pair(5) + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.GREEN_RIV = curses.color_pair(6)  + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.MAGENTA_RIV = curses.color_pair(7) + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		self.BLACK_RIV = curses.color_pair(8) + curses.A_BOLD + curses.A_BLINK + curses.A_REVERSE
		# Other options: A_DIM (half bright), A_STANDOUT, A_UNDERLINE
		self.loadColors()

	# This is the place where you can modify the colors that the Malvinas
	# system will use. Just take care in how you modify it. The colors
	# must be any of the defined above.
	def loadColors(self):
		# Main
		self.TITLE1 = self.BLUE_R
		self.TITLE2 = self.WHITE_R
		self.FRAME = self.BLUE
		self.STARTUP = self.CYAN_R
		self.MENU = self.BLUE_R
		self.BAR_CUR_TAB = self.WHITE_R
		self.BAR_OTH_TAB = self.CYAN
		self.BAR_TYPING = self.BLUE_R
		self.BAR_NEWMSG = self.BLUE_RI

		# Contact list
		self.CONTACTS = self.BLUE_R
		self.NUM_CONTACTS = self.WHITE
		self.GROUP1 = self.WHITE
		self.GROUP2 = self.BLACK_R
		self.STATUS_CONTACT_SEP = self.WHITE
		self.BLOCK_MARK = self.RED_R

		# Options win
		self.OPTIONS_WIN1 = self.BLUE_WHITE_BG
		self.OPTIONS_WIN2 = self.BLUE_WHITE_BG_R
		self.OPTIONS_WIN3 = self.BLACK_WHITE_B
		self.OPTIONS_WIN4 = self.WHITE_WHITE_BG_R
		self.OPTIONS_WIN5 = self.WHITE_CYAN_BG

		# Common events
		self.ERROR1 = self.RED
		self.ERROR2 = self.RED_R
		self.NOTIF = self.YELLOW
		self.MENU2 = self.BLACK_R
		self.EVENTS_BAR1 = self.WHITE_RI
		self.MSG_BLOCK = self.RED_R
		self.MSG_UNBLOCK = self.BLUE_R
		self.MSG_ADD = self.BLUE_RI
		self.MSG_ADD2 = self.WHITE_R
		self.MSG_DEL = self.RED_RI
		self.MSG_DEL2 = self.WHITE_R
		#self.PASSPORT = self.WHITE_R
		#self.TIME = self.WHITE
		#self.ACTION = self.CYAN
		#self.STD_MSG = self.CYAN
		#self.STATUSES = self.CYAN_R
